package com.yokit.c2c.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author fengzeng
 * @create 2021/6/20 17:38
 */
@ControllerAdvice
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

  /***
   * 静态资源放行
   * @param registry
   */
  @Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/image/**").addResourceLocations("file:D://tmp/img/");
  }
}